{
  "properties" : { },
  "id" : "82c85a1d93b7443587276dd91d0c9999",
  "script" : null,
  "groupId" : "e025d9b1d1d7414590e28943f156fc0b",
  "name" : "所有字段",
  "createTime" : null,
  "updateTime" : 1667964070712,
  "lock" : null,
  "createBy" : null,
  "updateBy" : null,
  "path" : "/all",
  "method" : "POST",
  "parameters" : [ ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"code\": -1,\n    \"message\": \"系统内部出现错误\",\n    \"data\": null,\n    \"timestamp\": 1666698940492,\n    \"executeTime\": 3055\n}",
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : {
    "name" : "",
    "value" : "",
    "description" : "",
    "required" : false,
    "dataType" : "Object",
    "type" : null,
    "defaultValue" : null,
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ {
      "name" : "code",
      "value" : "-1",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "message",
      "value" : "系统内部出现错误",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "data",
      "value" : "null",
      "description" : "",
      "required" : false,
      "dataType" : "Object",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "timestamp",
      "value" : "1666698940492",
      "description" : "",
      "required" : false,
      "dataType" : "Long",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "executeTime",
      "value" : "3055",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    } ]
  }
}
================================
import log;
import response;
import '@/evn/mkdirs' as fileMkdirs;

var path = "";
//祖父级目录处理
if (body.parentId == '-1') {
    path = body.libraryName
} else {
    var sql2 = """ select PATH from as_group where ID = #{body.parentId} """
    var reu = db.select(sql2).map(e => e.PATH);
    var parentPath = reu.get(0);
    path = parentPath + "/" + body.libraryName
}

//调用{创建文件夹}函数
var result = fileMkdirs(body, path);
if (result) {
    var sql = """
        insert into as_group (ID,PARENT_ID,LIBRARY_NAME,ORDERID,CREATE_BY,CREATE_DATE,DESCRIPTION,PATH) 
            values (#{body.id},#{body.parentId},#{body.libraryName},#{body.orderId},
                #{body.createBy},#{body.createDate},#{body.description},#{path})
    """
    return db.insert(sql)
} else {
    return response.json({
        success: false,
        message: '添加失败,目录已存在',
        code: 0
    });
}